package com.sky.mapper.common;

import com.sky.pojo.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description DishFlavorMapper
 * @Author 王富贵
 * @Date 2024-10-06
 */
public interface DishFlavorMapper {
    void batchSava(List<DishFlavor> flavors);

    void deleteByDishIds(List<Long> ids);

    @Delete("delete from dish_flavor where dish_id=#{id}")
    void deleteByDishId(Long id);

    void batchSave(List<DishFlavor> flavors);

    @Select("select a.*,b.name, b.value from dish a left join dish_flavor b on a.id = b.dish_id where a.id=#{id}")
    List<DishFlavor> getByDishId(Long id);
}
